package com.example.demo.service.impl;

import com.example.demo.entity.StudentCourse;
import com.example.demo.mapper.StudentCourseMapper;
import com.example.demo.service.StudentCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentCourseServiceImpl implements StudentCourseService {

    @Autowired
    private StudentCourseMapper studentCourseMapper;

    @Override
    public int insertStudentCourse(StudentCourse studentCourse) {
        return studentCourseMapper.insertStudentCourse(studentCourse);
    }

    @Override
    public int deleteStudentCourseById(int id) {
        return studentCourseMapper.deleteStudentCourseById(id);
    }

    @Override
    public int updateStudentCourse(StudentCourse studentCourse) {
        return studentCourseMapper.updateStudentCourse(studentCourse);
    }

    @Override
    public StudentCourse selectStudentCourseById(int id) {
        return studentCourseMapper.selectStudentCourseById(id);
    }

    @Override
    public List<StudentCourse> selectAllStudentCourses() {
        return studentCourseMapper.selectAllStudentCourses();
    }

    @Override
    public List<StudentCourse> selectStudentCoursesByStudentId(int studentId) {
        return studentCourseMapper.selectStudentCoursesByStudentId(studentId);
    }

    @Override
    public List<StudentCourse> selectStudentCoursesByCourseId(int courseId) {
        return studentCourseMapper.selectStudentCoursesByCourseId(courseId);
    }
}